zz_

test/isEven.test.js

zzmq.dev@gmail.com[dev1]/mathkit[add-isperfectsquare-n-function-tests] / test / isEven.test.js @ 38505f3e Download
Ladder Summary
  • file Contains unit tests to verify the functionality of the isEven function, testing positive numbers, negative numbers, and zero.
import { test } from "node:test";
import assert from "node:assert/strict";
import { isEven } from "../src/isEven.js";

test("isEven with positive numbers", () => {
  assert.strictEqual(isEven(1), false);
  assert.strictEqual(isEven(2), true);
});

test("isEven with negative numbers", () => {
  assert.strictEqual(isEven(-1), false);
  assert.strictEqual(isEven(-2), true);
});

test("isEven with zero", () => {
  assert.strictEqual(isEven(0), true);
});